<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
  <style>
    .active{
      color: red;
    }
  </style>
</head>
<body>
<div id="app">
<!--  <h2 v-bind:class="{keys:boolean,keys1:boolean}"></h2>-->
<!--  <h2 v-bind:class="{类名1:true,类名2:boolean}"></h2>-->
  <h2 v-bind:class="{active:isActive,line:isLine}">{{message}}</h2>
  <h2 v-bind:class="getClass()">{{message}}</h2>
  <button v-on:click="aoActive">点击</button>
</div>
<script src="../js/vue.js"></script>
<script>
  const app = new Vue({
    el:'#app',
    data:{
      message:'你好',
      isActive:true,
      isLine:true
    },
    methods:{
      aoActive:function (){
        this.isActive = !this.isActive
      },
     getClass:function (){
        return {active:this.isActive,
          line:this.isLine
        }
      }
    }
  })
</script>
</body>
</html>